import java.util.Scanner;

/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2212 2213
 * @Package: PACKAGE_NAME
 * @File: While2.java
 * @Time: 2022/12/3 10:56
 * @Author: abcque
 * @Description: 渔夫打渔筛网问题
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class While2 {
    public static void main(String[] args) {
        // step1、 通过键盘输入年月日，保存到 year、month、day 中
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = scanner.nextInt();
        System.out.println("请输入年月份");
        int month = scanner.nextInt();
        System.out.println("请输入日期");
        int day = scanner.nextInt();

        // step2、计算日期对应的天数
        int count = 0;
        // 1) 处理年份
        // 年份状态，默认是平年
        boolean leapYear = true;
        if ((year % 100 == 0 && year % 400 == 0) && (year % 100 != 0 && year % 4 == 0)) {
            leapYear = false;
        }

        // 2) 处理月份
        switch (month-1){
            case 11:
                count += 30;
            case 10:
                count += 31;
            case 9:
                count += 30;
            case 8:
                count += 31;
            case 7:
                count += 31;
            case 6:
                count += 30;
            case 5:
                count += 31;
            case 4:
                count += 30;
            case 3:
                count += 31;
            case 2:
                if (leapYear){
                    count += 28;
                }
                else {
                    count += 29;
                }
            case 1:
                count += 31;
            case 0:
                count += 0;
        }
        // 3) 处理日期
        count += day;
        System.out.println("count = " + count);

        // step3、判断渔夫打渔筛网状态
        while (count >5){
            count -= 5;
        }
        if (1<= count && count <=3){
            System.out.println("渔夫在打渔");
        }
        else {
            System.out.println("渔夫在晒网");
        }
    }
}
